<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <ui:composition>
        <h:form id="frm_fcb">
            <h:outputText id="txt_add" value="#{msg.office_txt_add_value}"/>
            <p:commandButton id="btn_new" value="#{msg.btn_new}" onclick="fcbNewDialog.show()" update="dagr_fcb, txt_nofcb"/>
            <p:separator/>
            <h:outputText id="txt_nofcb" value="#{msg.office_txt_nofcb_value}" rendered="#{showClassRoomBean.listFileCardBoxIsEmpty()}"/>
            <p:dataGrid id="dagr_fcb" columns="3" var="fcb" value="#{showClassRoomBean.fileCardBoxDataModel}" rendered="#{!showClassRoomBean.listFileCardBoxIsEmpty()}">
                <p:panel header="#{fcb.title}" styleClass="noborder">
                    <p:panelGrid columns="2" styleClass="noborder">
                        <h:outputText id="lbl_cfc1" value="#{msg.office_lbl_cfc1_value}"/>
                        <h:outputText id="lbl_cfc2" value="#{fcb.category.name}" title="#{fcb.category.description}"/>
                        <h:outputText id="lbl_cfc3" value="#{msg.office_lbl_cfc3_value}"/>
                        <h:outputText id="lbl_cfc4" value="#{fcb.fileCards.size()}"/>
                    </p:panelGrid>
                    <p:panelGrid columns="6" styleClass="noborder">
                        <h:outputText id="lbl_cat0" value="#{showClassRoomBean.unknownLearnStatus}"/>
                        <h:outputText id="lbl_cat1" value="#{showClassRoomBean.worstStatusForFileCards}"/>
                        <h:outputText id="lbl_cat2" value="#{showClassRoomBean.badStatusForFileCards}"/>
                        <h:outputText id="lbl_cat3" value="#{showClassRoomBean.goodStatusForFileCards}"/>
                        <h:outputText id="lbl_cat4" value="#{showClassRoomBean.betterStatusForFileCards}"/>
                        <h:outputText id="lbl_cat5" value="#{showClassRoomBean.bestStatusForFileCards}"/>
                    </p:panelGrid>
                    <f:facet name="footer">
                        <p:commandButton id="btn_edit" value="#{msg.btn_edit}" actionListener="#{fCBViewBean.open}" immediate="true" update=":fs_work" >
                            <f:attribute name="fcbid" value="#{fcb.id}"/>
                        </p:commandButton>
                        <p:commandButton id="btn_learn" value="#{msg.btn_learn}" actionListener="#{learnWizardBean.open}" immediate="true" update=":fs_work">
                            <f:attribute name="fcbid" value="#{fcb.id}"/>
                        </p:commandButton>
                        <p:commandButton id="btn_delete" value="#{msg.btn_delete}" actionListener="#{fileCardBoxBean.delete}" update=":frm_fcb">
                            <f:attribute name="cltype" value="#{showClassRoomBean.typeString()}"/>
                            <f:attribute name="clid" value="#{showClassRoomBean.classRoom.id}"/>
                            <f:attribute name="fcbid" value="#{fcb.id}"/>
                        </p:commandButton>
                    </f:facet>
                </p:panel>
            </p:dataGrid>
            <p:confirmDialog id="dlg_del" widgetVar="dlgDel">
                <h:outputText id="lbl_dlg_del1" value="Möchten sie diesen Karteikartenkasten löchen?"/>
                <br/>
                <h:outputText id="lbl_dlg_del2" value="Es wird der Karteikasten, die Karteikarten und der Lernstand gelöscht"/>
            </p:confirmDialog>
        </h:form>
        <ui:decorate template="/faces/user/dialognewfcb.xhtml"/>
    </ui:composition>
</html>

